<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>新增招聘计划</title>
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="static/easyui/themes/icon.css">
<link rel="stylesheet" href="static/easyui/themes/metro/easyui.css">
</head>
<body>
<style type="text/css">
ul li{
	list-style:none;
	font-size:14px;
	margin-top:20px;
}
.mes{
		height:40px;
		width: 1000px;
   	 	margin: 10px auto;
    	background-color: #F4F4F4;
}
.recruitcontent{
		width:1000px;
		height:330px;
		margin:20px auto;
}
#addplan{
		text-align: center;
   	 	color: #56BFAA;
    	font-size: 18px;
    	line-height: 40px;
    	display: block;
}
#addcontent{
		height:30px;
}  
 .addjobs-bottom{
		width:220px;
		height:30px;
		margin:30px auto;
		display:block;
}
.return{
		width:60px;
		height:25px;
		color:white;
		cursor: pointer;
		margin:5px auto;
		border:none;
}
.save{
		width:60px;
		height:25px;
		color:white;
		cursor: pointer;
		margin:5px 46px;
		border:none;
}
.icon-addprogram-baocun{
		padding-left: 20px;
		background:url('static/easyui/themes/icons/baocun.png') no-repeat 5% 50%;
		background-color:#2DB096;
}
.icon-addprogram-fanhui{
		padding-left: 20px;
		background:url('static/easyui/themes/icons/fanhui.png') no-repeat 5% 50%;
		background-color:#F4A328;
}
.insertjobs-two{
	margin-top:10px;
	width:600px;
	height:170px;
}
.insertjobs-two ul li{
	margin-top:5px;
	font-size:13px;
	color:#333333;
	margin-left:20px;
}
.insertjob-three{
	width:150px;
	height:30px;
	float:right;
}
#close{
	width:60px;
	height:25px;
	color:white;
	font-size:13px;
	border:none;
	cursor:pointer;
	background-color:#55BEA9;
}
#beok{
	width:60px;
	height:25px;
	font-size:13px;
	color:white;
	border:none;
	cursor:pointer;
	background-color:#55BEA9;
}
.easyui-window{
	width:600px;
	height:230px;
}
.button-no{
	width:60px;
	height:25px;
	color:white;
	border:none;
	cursor:pointer;
}
.button-ok{
	width:60px;
	height:25px;
	margin-left:10px;
	color:white;
	border:none;
	cursor:pointer;
}
.icon-conpany-quxiao{
		padding-left: 20px;
		background:url('static/easyui/themes/icons/quxiao.png') no-repeat 5% 50%;
		background-color:#55BEA9;
}
.icon-conpany-queding{
		padding-left: 20px;
		background:url('static/easyui/themes/icons/queding.png') no-repeat 5% 50%;
		background-color:#55BEA9;
}
#rplanstart,#rplanend,#rplanexitstart,#rplanexitend{
		width:240px;	
	}
.add-left{
		width:360px;
		height:220px;
		float:left;
		margin-left:50px;
}
.add-right{
		width:445px;
		height:220px;
		float:right;
		margin-right:-30px;
}
.add-left ul li,.add-right ul li{
		margin-top:18px;
}
</style>
<script type="text/javascript">
	$(function(){
		
		//新增招聘计划
		$("#addprogram-save").click(function(){
			//招聘部门
			var dept_id = $("#dept_id").val();
			//招聘职位
			var postione_id = $("#zhiwei").val();
			//招聘开始时间
			var rplanstart = $("#rplanstart").val();
			//招聘负责人
			var staff_id = $("#staff_id").val();
			//招聘结束时间
			var rplanend = $("#rplanend").val();
			//计划名称
			var rplanname = $("#rplanname").val();
			//招聘方式
			var rplanway = $("#rplanway").val();
			//招聘地点
			var rplanplace = $("#rplanplace").val();
			
			if(rplanname==null || rplanname=="null" || rplanname==""){
				alert("请输入计划名称");
			}else if(dept_id==null || dept_id=="null" || dept_id==""){
				alert("请输入部门");
			}else if(postione_id==null || postione_id=="null" || postione_id==""){
				alert("请输入职位");
			}else if(rplanway==null || rplanway=="null" || rplanway==""){
				alert("请输入招聘方式");
			}else if(rplanstart==null || rplanstart=="null" || rplanstart==""){
				alert("请输入招聘开始时间");
			}else if(rplanend==null || rplanend=="null" || rplanend==""){
				alert("请输入招聘结束时间");
			}else if(staff_id==null || staff_id=="null" || staff_id==""){
				alert("请输入负责人");
			}else if(rplanplace==null || rplanplace=="null" || rplanplace==""){
				alert("请输入招聘地点");
			}else{
				$.ajax({
					url:"rplans",
					type:"post",
					data:{
						dept_id:dept_id,
						postione_id:postione_id,
						rplanstart:rplanstart,
						staff_id:staff_id, 
						rplanend:rplanend,
						rplanname:rplanname,
						rplanway:rplanway,
						rplanplace:rplanplace
						},
				})
				$("#content-admin").panel('open').panel('refresh','recruitprogram');
				$("#recruitaddprogram").window("close");	
			}
		
		})	
		//点击返回按钮
		$("#addprogram-return").click(function(){
			add("recruitprogram");
	});
		//招聘职位
		$('#postione_name').combogrid({
	        panelWidth:200,
	        url:'select_zhiweiKuang',
	        singleSelect:true,
	        idField:'position_name',
	        treeField:'position_name',
	        columns:[[
	        	{field:'sortable',title:'#',width:35,align:'center'},
	        	{field:'position_id',hidden:true},
	            {field:'position_name',title:'招聘职位',width:160,align:'center'}
	        ]],
	        onClickRow:function(rowIndex, rowData){
	    		$("#zhiwei").val(rowData['position_id']);
	    	}
	    });
		//招聘部门
		$('#departName').combogrid({
	        panelWidth:200,
	        url:'select_sousuoKuang',
	        singleSelect:true,
	        idField:'depart_name',
	        treeField:'depart_name',
	        columns:[[
	        	{field:'sortable',title:'#',width:35,align:'center'},
	        	{field:'Depart_id',hidden:true},
	            {field:'depart_name',title:'招聘部门',width:160,align:'center'}
	        ]],
	        onClickRow:function(rowIndex, rowData){
	    		$("#dept_id").val(rowData['Depart_id']);
	    	}
	    });
		//招聘负责人
		$('#Staff_name').combogrid({
	        panelWidth:200,
	        url:'select_sousuoKuang',
	        singleSelect:true,
	        idField:'Staff_name',
	        treeField:'Staff_name',
	        columns:[[
	        	{field:'sortable',title:'#',width:35,align:'center'},
	        	{field:'Staff_id',hidden:true},
	            {field:'Staff_name',title:'招聘负责人',width:160,align:'center'}
	        ]],
	        onClickRow:function(rowIndex, rowData){
	    		$("#staff_id").val(rowData['staff_id']);
	    	}
	    });
	});
	function add(text){   
		console.log(text);
		$("#content-admin").panel({
			href:text
		})
	}
</script>
<!-- 新增项目 -->
   <div class="addprgram">
   	  <div class="mes"><span id="addplan">新增招聘计划</span></div>
   	   <div class="recruitcontent"> 
   	   
   	   	<div class="add-left">
   	   	<input type="hidden" id="dept_id">
   	   	<input type="hidden" id="zhiwei">
   	   	<input type="hidden" id="staff_id">
   	   	 <ul>
   	   	 	<li><span>计划名称：</span><input type="text" id="rplanname" style="width:240px;height:20px;"></li>
   	  		<li><span>招聘部门：</span><input type="text" id="departName" style="width:245px;height:26px;"></li>
   	  		<li><span>招聘职位：</span><input type="text" id="postione_name" style="width:245px;height:26px;"></li>
   	  		<li>
   	  			<span>招聘方式：</span>
   	  				<select id="rplanway" style="width:240px;height:20px;">
   	  					<option>--请选择--</option>
   	  					<option>校园招聘</option>
   	  					<option>内部招聘</option>
   	  					<option>外部招聘</option>
   	  				</select>
   	  		</li>
   	  	</ul>
   	  </div>
   	  <div class="add-right">
   	  	<ul>
   	  		<li><span>招聘地点：</span><input id="rplanplace" type="text" style="width:240px;;height:20px;"></li>
   	  		<li><span style="margin-left:-15px;">招聘负责人：</span><input id="Staff_name" type="text" style="width:245px;height:26px;"></li> 		
   	  		<li><span style="margin-left:-29px;">计划开始时间：</span><input id="rplanstart" type="text" class="easyui-datebox" required="required"></li>	
   	  		<li><span style="margin-left:-29px;">计划结束时间：</span><input id="rplanend" type="text" class="easyui-datebox" required="required"></li>  	  		
   	  	</ul>
   	  </div>
   	  </div>
   	  <div class="addjobs-bottom">
   	  		<button id="addprogram-return" class="return icon-addprogram-fanhui">返回</button>
   	  		<button id="addprogram-save" class="save icon-addprogram-baocun">保存</button>
   	  	</div>
   </div> 
</body>
</html>